﻿Public Class TMyIndex
    Friend _Columns As New List(Of TMyIndexColumn)
    Friend _TableCatalog As String
    Friend _TableSchema As String
    Friend _TableName As String
    Friend _NonUnique As Boolean
    Friend _IndexSchema As String
    Friend _IndexName As String
    Friend _Cardinality As Integer
    Friend _SubPart As Integer
    Friend _Packed As String
    Friend _Nullable As String
    Friend _IndexType As String
    Friend _Comment As String
    Friend _IndexComment As String
    Friend Sub Clear()
        _Columns.Clear()
    End Sub
    Public ReadOnly Property IsPrimaryKey() As Boolean
        Get
            Return _IndexName.Equals("PRIMARY")
        End Get
    End Property
    Public ReadOnly Property IsUnique() As Boolean
        Get
            Return _NonUnique.Equals(0)
        End Get
    End Property
    Public ReadOnly Property IsBTree() As Boolean
        Get
            Return _IndexType.Equals("BTREE")
        End Get
    End Property

    Public ReadOnly Property Columns(ByVal AIndex As Integer) As TMyIndexColumn
        Get
            Return _Columns(AIndex)
        End Get
    End Property

    Public ReadOnly Property ColumnCount() As Integer
        Get
            Return _Columns.Count
        End Get
    End Property

    Friend Sub Add(ByVal AColumn As TMyIndexColumn)
        _Columns.Add(AColumn)
    End Sub

    Public ReadOnly Property TableCatalog() As String
        Get
            Return _TableCatalog
        End Get
    End Property

    Public ReadOnly Property TableSchema() As String
        Get
            Return _TableSchema
        End Get
    End Property

    Public ReadOnly Property TableName() As String
        Get
            Return _TableName
        End Get
    End Property

    Public ReadOnly Property NonUnique() As Boolean
        Get
            Return _NonUnique
        End Get
    End Property

    Public ReadOnly Property IndexSchema() As String
        Get
            Return _IndexSchema
        End Get
    End Property

    Public ReadOnly Property IndexName() As String
        Get
            Return _IndexName
        End Get
    End Property

    Public ReadOnly Property Cardinality() As Integer
        Get
            Return _Cardinality
        End Get
    End Property

    Public ReadOnly Property SubPart() As Integer
        Get
            Return _SubPart
        End Get
    End Property

    Public ReadOnly Property Packed() As String
        Get
            Return _Packed
        End Get
    End Property

    Public ReadOnly Property Nullable() As String
        Get
            Return _Nullable
        End Get
    End Property

    Public ReadOnly Property IndexType() As String
        Get
            Return _IndexType
        End Get
    End Property

    Public ReadOnly Property Comment() As String
        Get
            Return _Comment
        End Get
    End Property

    Public ReadOnly Property IndexComment() As String
        Get
            Return _IndexComment
        End Get
    End Property

End Class
